<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/12/13
 * Time: 19:14
 */
include "config.php";
include "status.php";
if($_SERVER["REQUEST_METHOD"]!="POST")
{
    print_r(json_encode(Status::$reg_nget));
    return;
}
$UID = $_POST["u_id"]; // 用户id
$GID=$_POST["gid"];//产品id

$sqlQuery = "SELECT * FROM cart WHERE u_id=?";
$stmt = $conn->prepare($sqlQuery);
$stmt->bind_param("i", $UID);
$stmt->execute();
$queryResult = $stmt->get_result();
$sqlDelete="DELETE FROM cart WHERE u_id=? AND g_id=?";
$stmtU=$conn->prepare($sqlDelete);
$stmtU->bind_param("ii",$UID,$GID);
$stmtU->execute();
$result=$stmtU->get_result();
print_r(json_encode($result));
$stmtU->close();
$stmt->close();
$conn->close();
